import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { JVxeTypes, JVxeColumn } from '/@/components/jeecg/JVxeTable/types'
//列表数据
export const columns : BasicColumn[] = [
	{
		title: '用户',
		align: "center",
		dataIndex: 'userId_dictText'
	},
	{
		title: '是否发起人',
		align: "center",
		dataIndex: 'isSponsor_dictText'
	},
	{
		title: '活动',
		align: "center",
		dataIndex: 'mainId_dictText'
	},
	{
		title: '拼包车id',
		align: "center",
		dataIndex: 'carpoolBus_dictText'
	},
/* 	{
		title: '拼包车类别',
		align: "center",
		dataIndex: 'carpoolType_dictText'
	}, */
	{
		title: '订单状态',
		align: "center",
		dataIndex: 'orderStatus_dictText'
	},
	{
		title: '订单金额',
		align: "center",
		dataIndex: 'orderPrice'
	},
	{
		title: '支付金额',
		align: "center",
		dataIndex: 'payPrice'
	},
	{
		title: '实际花费金额',
		align: "center",
		dataIndex: 'actualCostPrice'
	},
	{
		title: '退款金额',
		align: "center",
		dataIndex: 'refundPrice'
	},
	{
		title: '结算价',
		align: "center",
		dataIndex: 'settlementPrice'
	},
	{
		title: '待收款',
		align: "center",
		dataIndex: 'unpaidPrice'
	},
	{
		title: '报名人数',
		align: "center",
		dataIndex: 'registrationPopulation'
	},
	{
		title: '转出转入',
		align: "center",
		dataIndex: 'rollOrIn_dictText'
	},
/* 	{
		title: '转出到商家',
		align: "center",
		dataIndex: 'rollOutShopId'
	}, */
	{
		title: '商家',
		align: "center",
		dataIndex: 'rollInShopId_dictText'
	},
	{
		title: '订单编号',
		align: "center",
		dataIndex: 'orderNo'
	},
];
//查询数据
export const searchFormSchema : FormSchema[] = [
	{
		label: "用户",
		field: "userId",
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_user,user_name,id"
		},
		//colProps: {span: 6},
	},
	{
		label: "是否发起人",
		field: "isSponsor",
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "is"
		},
		//colProps: {span: 6},
	},
	{
		label: "活动",
		field: "mainId",
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_main,title,id"
		},
		//colProps: {span: 6},
	},
	{
		label: "拼包车id",
		field: "carpoolBus",
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_carpool_bus,carpool_number,id"
		},
		//colProps: {span: 6},
	},
	{
		label: "拼包车类别",
		field: "carpoolType",
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "carpool_type"
		},
		//colProps: {span: 6},
	},
	{
		label: "订单状态",
		field: "orderStatus",
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "order_status"
		},
		//colProps: {span: 6},
	},
	{
		label: "转出转入",
		field: "rollOrIn",
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "rool_or_in"
		},
		//colProps: {span: 6},
	},
];
//表单数据
export const formSchema : FormSchema[] = [
	{
		label: '用户',
		field: 'userId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_user,user_name,id"
		},
	},
	{
		label: '是否发起人',
		field: 'isSponsor',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "is"
		},
	},
	{
		label: '活动',
		field: 'mainId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_main,title,id"
		},
	},
	{
		label: '拼包车id',
		field: 'carpoolBus',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_carpool_bus,carpool_number,id"
		},
	},
	{
		label: '拼包车类别',
		field: 'carpoolType',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "carpool_type"
		},
	},
	{
		label: '订单状态',
		field: 'orderStatus',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "status_carpool"
		},
	},
	{
		label: '报名人数',
		field: 'registrationPopulation',
		component: 'InputNumber',
	},
	{
		label: '转出转入',
		field: 'rollOrIn',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "rool_or_in"
		},
	},
	{
		label: '转出到商家',
		field: 'rollOutShopId',
		component: 'Input',
	},
	{
		label: '商家转入',
		field: 'rollInShopId',
		component: 'Input',
	},
	{
		label: '订单编号',
		field: 'orderNo',
		component: 'Input',
	},
	// TODO 主键隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
];
//子表单数据



//子表列表数据
export const coupleActivityOrderColumns : BasicColumn[] = [
	{
		title: '用户',
		align: "center",
		dataIndex: 'userId_dictText'
	},
	{
		title: '是否发起人',
		align: "center",
		dataIndex: 'isSponsor_dictText'
	},
	{
		title: '活动',
		align: "center",
		dataIndex: 'mainId_dictText'
	},
	{
		title: '拼包车id',
		align: "center",
		dataIndex: 'carpoolBus_dictText'
	},
	{
		title: '拼包车类别',
		align: "center",
		dataIndex: 'carpoolType_dictText'
	},
	{
		title: '订单状态',
		align: "center",
		dataIndex: 'orderStatus_dictText'
	},
	{
		title: '报名人数',
		align: "center",
		sorter: true,
		dataIndex: 'registrationPopulation'
	},
	{
		title: '转出转入',
		align: "center",
		dataIndex: 'rollOrIn_dictText'
	},
	{
		title: '转出到商家',
		align: "center",
		dataIndex: 'rollOutShopId_dictText'
	},
	{
		title: '商家转入',
		align: "center",
		dataIndex: 'rollInShopId'
	},
	{
		title: '订单编号',
		align: "center",
		dataIndex: 'orderNo'
	},
	{
		title: '拼包车编号',
		align: "center",
		dataIndex: 'carpoolBusNo'
	},
	{
		title: '支付方式',
		align: "center",
		dataIndex: 'payType_dictText'
	},
	{
		title: '支付单号',
		align: "center",
		dataIndex: 'payNo'
	},
	{
		title: '支付金额',
		align: "center",
		sorter: true,
		dataIndex: 'payPrice'
	},
];
//子表表单数据
export const coupleActivityOrderFormSchema : FormSchema[] = [
	// TODO 子表隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
	{
		label: '用户',
		field: 'userId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_user,user_name,id"
		},
	},
	{
		label: '是否发起人',
		field: 'isSponsor',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "is"
		},
	},
	{
		label: '活动',
		field: 'mainId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_main,title,id"
		},
	},
	{
		label: '拼包车id',
		field: 'carpoolBus',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_carpool_bus,carpool_number,id"
		},
	},
	{
		label: '拼包车类别',
		field: 'carpoolType',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "carpool_type"
		},
	},
	{
		label: '订单状态',
		field: 'orderStatus',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "order_status"
		},
	},
	{
		label: '报名人数',
		field: 'registrationPopulation',
		component: 'InputNumber',
	},
	{
		label: '转出转入',
		field: 'rollOrIn',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "rool_or_in"
		},
	},
	{
		label: '转出到商家',
		field: 'rollOutShopId',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: ""
		},
	},
	{
		label: '商家转入',
		field: 'rollInShopId',
		component: 'Input',
	},
	{
		label: '订单编号',
		field: 'orderNo',
		component: 'Input',
	},
	{
		label: '拼包车编号',
		field: 'carpoolBusNo',
		component: 'Input',
	},
	{
		label: '支付方式',
		field: 'payType',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: ""
		},
	},
	{
		label: '支付单号',
		field: 'payNo',
		component: 'Input',
	},
	{
		label: '支付金额',
		field: 'payPrice',
		component: 'InputNumber',
	},
];


//子表列表数据
export const coupleActivityOrderApplyInfoColumns: BasicColumn[] = [
   {
    title: '身份证',
    align:"center",
    dataIndex: 'card'
   },
   {
    title: '姓名',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '电话',
    align:"center",
    dataIndex: 'phone'
   },
   {
    title: '合同id',
    align:"center",
    dataIndex: 'contractId_dictText'
   },
   {
    title: '合同',
    align:"center",
    dataIndex: 'contractImg'
   },
   {
    title: '签名图',
    align:"center",
    dataIndex: 'signatureImg'
   },
   {
    title: '报名人',
    align:"center",
    dataIndex: 'userId_dictText'
   },
   {
    title: '签字人',
    align:"center",
    dataIndex: 'signatureId_dictText'
   },
   {
    title: '活动',
    align:"center",
    dataIndex: 'activityId_dictText'
   },
];
//子表表单数据
export const coupleActivityOrderApplyInfoFormSchema: FormSchema[] = [
  // TODO 子表隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false
  },
  {
    label: '身份证',
    field: 'card',
    component: 'Input',
  },
  {
    label: '姓名',
    field: 'name',
    component: 'Input',
  },
  {
    label: '电话',
    field: 'phone',
    component: 'Input',
  },
  {
    label: '合同id',
    field: 'contractId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"content,title,id"
     },
    dynamicDisabled:true,
  },
  {
    label: '合同',
    field: 'contractImg',
    component: 'Input',
  },
  {
    label: '签名图',
    field: 'signatureImg',
    component: 'Input',
  },
  {
    label: '报名人',
    field: 'userId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"couple_user,user_name,id"
    },
  },
  {
    label: '签字人',
    field: 'signatureId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"couple_user,user_name,id"
    },
  },
  {
    label: '活动',
    field: 'activityId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"couple_user,user_name,id"
    },
  },
];

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData) : FormSchema[] {
	// 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
	return formSchema;
}